package com.nwpu.coursesupport.view.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nwpu.coursesupport.controller.AbstractController;
import com.nwpu.coursesupport.entity.bean.JSONResult;

@Controller	
@RequestMapping("/lessonTaskInLessonDetail")
public class LessonTaskInLessonDetailViewController extends AbstractController{
	
	@RequestMapping("/ajaxDetail")
	@ResponseBody
	public JSONResult tAjaxDetail(@RequestParam("id")int id){
		JSONResult rst=invokeService("lessonTaskInLessonDetailView", "teacherDetailView","{\"id\":\"" + id+ "\"}");
		return rst;
	}
	
	@RequestMapping("/detail")
	public String tDetail(@RequestParam("id")int id,HttpServletRequest request){
		JSONResult rst=invokeService("lessonTaskInLessonDetailView", "teacherDetailView","{\"id\":\"" + id+ "\"}");
		request.setAttribute("data", this.parseData(rst));
		return "/teapage/classroomTaskSubmit";
	}
	
}
